package com.ct.dao.common.hibernate;

import org.hibernate.classic.Session;
import org.hibernate.SessionFactory;
import com.ct.dao.common.ObjectProvider;

/**
 * Created by IntelliJ IDEA.
 * User: nmkravchenko
 * Date: 22.10.2009
 * Time: 17:27:24
 * To change this template use File | Settings | File Templates.
 */
public class CurrentSessionProvider implements ObjectProvider<Session>{
    private SessionFactory _sessionFactory;

    public Session get() {
        return _sessionFactory.getCurrentSession();
    }

    public CurrentSessionProvider(SessionFactory aSessionFactory) {
        _sessionFactory = aSessionFactory;
    }
}
